package com.gxa.zhonglong.service.impl;

import com.gxa.zhonglong.mapper.InventoryOutMapper;
import com.gxa.zhonglong.pojo.InventoryOut;
import com.gxa.zhonglong.pojo.Storage;
import com.gxa.zhonglong.service.InventoryOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.List;

@Service("inventoryOutService")
@Transactional(rollbackFor = {Throwable.class})
public class InventoryOutServiceImpl implements InventoryOutService {

    @Autowired
    private InventoryOutMapper inventoryOutMapper;


    @Override
    public void add(InventoryOut inventoryOut) {
        inventoryOutMapper.add(inventoryOut);
    }

    @Override
    public List<Storage> getListByID(List<String> numbers) {
        List<Storage> listByID = inventoryOutMapper.getListByID(numbers);
        return listByID;
    }
  @Override
    public InventoryOut selectByNum(String num) {
        InventoryOut inventoryOut = inventoryOutMapper.selectByNum(num);
        return inventoryOut;
    }

    @Override
    public void reject(String ename, Timestamp etime,String num) {
        inventoryOutMapper.reject(ename,etime,num);
    }

    @Override
    public void approve(String ename, Timestamp etime,String num) {
            inventoryOutMapper.approve(ename,etime,num);
    }

    @Override
    public void revokeReject(String num) {
        inventoryOutMapper.revokeReject(num);
    }

    @Override
    public void delete(String num) {
        inventoryOutMapper.delete(num);
    }
}
